import http from "@/utils/request";
import model from "@/config/model";
export default {
  queryWithPage: {
    url: `${model.API_URL}/user-management/v1.0/user/query-with-page`,
    name: "用户管理表-分页查询",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  save: {
    url: `${model.API_URL}/user-management/v1.0/user/save`,
    name: "用户管理表-新增",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  modify: {
    url: `${model.API_URL}/user-management/v1.0/user/modify`,
    name: "用户管理表-修改",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  empower: {
    url: `${model.API_URL}/user-management/v1.0/user/empower`,
    name: "用户管理表-赋权",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  delete: {
    url: `${model.API_URL}/user-management/v1.0/user/delete/`,
    name: "用户管理表-删除",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  deleteBatch: {
    url: `${model.API_URL}/user-management/v1.0/user/delete-batch`,
    name: "用户管理表-批量删除",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  changeInvalid: {
    url: `${model.API_URL}/user-management/v1.0/user/change-status/`,
    name: "用户管理表-更改状态",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  queryById: {
    url: `${model.API_URL}/user-management/v1.0/user/`,
    name: "用户管理表-查询",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  queryByCustom: {
    url: `${model.API_URL}/user-management/v1.0/user/query-by-custom`,
    name: "用户管理表-自定义查询",
    post: async function (data) {
      return await http.post(this.url, data);
    },
  },
  resetPassword: {
    url: `${model.API_URL}/user-management/v1.0/user/reset-password/`,
    name: "用户管理表-重置密码",
    get: async function (data) {
      return await http.get(this.url + data);
    },
  },
  exportData: {
    url: `${model.API_URL}/user-management/v1.0/user/export-excel`,
    name: "用户管理表-导出",
    post: async function (data) {
      return await http.down(this.url, data, {
        headers: {
          "Content-Type": "application/json;charset=UTF-8",
          exportFlag: "1",
          channelCode: "C01",
        },
        method: "post",
      });
    },
  },
  removeAva: {
    url: `${model.API_URL}/user-management/v1.0/user/remove-ava`,
    name: "移除用户头像",
    get: async function (param) {
      return await http.get(this.url, param);
    },
  },
};
